<template>
	<view class="inputs">
		<view class="cu-form-group margin-top">
			<textarea maxlength="-1" :disabled="modalName!=null" @input="onInput" :placeholder="hint"></textarea>
		</view>
		<view class="cu-form-toast" v-if="toast.length > 0">{{ toast }}</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			modalName:null,
			inputValue: this.value,
			toast: '',
			timer: Object,
			btntxt:60,
			isClick:false
		};
	},
	name: 'inputs',
	computed: {
		style() {
			var style = '';
			return style;
		}
	},
	props: {
		datas: {},
		mold: {
			type: String,
			default: ''
		},
		hint: {
			type: String,
			default: '请输入内容'
		},
		title: {
			type: String,
			default: ''
		},
		value: {
			type: String,
			default: ''
		},
		icon: {
			type: String,
			default: ''
		},
		Bgcolor: {
			type: String,
			default: 'red'
		}
		
	},onHide() {
		clearInterval(this.timer);
	},created() {
		
	},watch:{
		hint:function(res){
			
		}
	},
	methods: {
		onClose() {
			this.inputValue = '';
			this.toast = '';
			this.$emit('onchange', this.inputValue);
		},
		onInput(e) {
			this.inputValue = e.target.value;
			if (this.inputValue.length == 0) {
				this.toast = '';
			}
			this.$emit('onchange', this.inputValue);
		}
	}
};
</script>

<style scoped>
.cu-form-toast {
	text-align: center;
	padding: 6rpx;
	font-size: 28upx;
	color: #ff0000;
	border-top: solid 1upx #efefef;
	border-bottom: solid 1upx #efefef;
	background-color: #ffffff;
	font-weight: 800;
}
.inputs {
	width: 100%;
}
</style>
